package javalangspec;

public class ArrayStoreExceptionDemo {
	public static void main(String[] args) {
		ColoredPoint[] cpa = new ColoredPoint[10];
		Point[] pa = cpa;
		System.out.println(pa[1] == null);
		try {
			pa[0] = new Point();
		} catch (ArrayStoreException e) {
			System.out.println(e);
		}
		
//		Point[] p = new Point[5];
//		ColoredPoint[] cp = (ColoredPoint[]) p;
//		System.out.println(cp[2]);
		
//		Point p = new Point();
//		ColoredPoint cp = (ColoredPoint) p;
//		System.out.println(cp);
	}
}

class Point {
	int x, y;
}

class ColoredPoint extends Point {
	int color;
}
